package com.xgk.boot.module.core.dal.entity.truck;

import com.baomidou.mybatisplus.annotation.*;
import com.xgk.boot.framework.mybatis.core.dataobject.BaseNoDO;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.time.Instant;

/**
 * 订单操作日志实体(记录订单流程每个环节流转日志)
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("truck_order_log")
public class TruckOrderLogDO extends BaseNoDO {

    @TableId(value = "ol_id", type = IdType.ASSIGN_ID)
    private Long olId;

    /** 操作类型：add/edit/submit/change/out/other */
    @TableField("op_type")
    private String opType;

    /** 订单ID */
    @TableField("order_id")
    private Long orderId;

    /** 订单编号 */
    @TableField("order_code")
    private String orderCode;

    /** 变更类型：0-状态 1-内容 */
    @TableField("ol_type")
    private Integer olType;

    /** 变更前状态 */
    @TableField("order_status_from")
    private Integer orderStatusFrom;

    /** 变更后状态 */
    @TableField("order_status_to")
    private Integer orderStatusTo;

    /** 操作用户ID */
    @TableField("user_id")
    private Long userId;

    /** 操作用户ID */
    @TableField("user_name")
    private String userName;

    /** 操作IP */
    @TableField("ol_ip")
    private String olIp;

    /** 操作备注 */
    @TableField("ol_comments")
    private String olComments;

    /**
     * 操作时间戳
     */
    @TableField("ol_timestamp")
    private Instant olTimestamp = Instant.now();


}